﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CIIS.Common;
using DevExpress.XtraEditors;
using Contract.Domain;

namespace CIIS
{
    public partial class VerifyManage : Manage
    {
        public VerifyManage()
        {
            InitializeComponent();

            InitUserControl();
        }

        private void InitUserControl()
        {
            //InitButtons(new string[] { "添加" }, new EventHandler[] { btnAdd_click });
            RegisterOptFormType(typeof(SecretPersonVerify), typeof(SecretPersonVerify));

            BindGridData(typeof(t_tq_tqry));

            InitParamControl(new bool[] { false, true, true, false, true, true },
                new string[] { "", "呈报单位：", "代号：", "", "姓名：", "审核状态" },
                new DropdownControlParam[] { null, null, null, null, null, dao.GetDropdownControlParam<bm_shzt>() });

            InitGridViewDataColumns(new string[] { "选中", "代号", "姓名", "身份证号", "类别", "准建时间", "使用人", "变更情况", "审核状态" },
                new string[] { "IsSelected", "RYDH", "XM", "SFZH", "GNLB", "RKSJ", "SYMJ", "BGLX", "SHZT" },
                new DropdownControlParam[] { null, null, null, null, null, null, null, null, dao.GetDropdownControlParam<bm_shzt>() });

            //InitGridViewOptColumnWithEvent(new string[] { "详情", "审核" },
            //    new EventHandler[] { linkDetail_click, linkVerify_click });
            InitGridViewOptColumnWithFlag(new string[] { "详情", "审核" },
                new EOperateType[] { EOperateType.Detail, EOperateType.Verify });
        }

        public override void FilterGridViewByDefault()
        {
            base.FilterGridViewByDefault();

            //todo pxc 需要根据分局市局做过滤
            FilterGridView("[SHZT] = '00'");
        }

        ///// <summary>
        ///// 详情与411相同
        ///// </summary>
        ///// <param name="sender"></param>
        ///// <param name="ent"></param>
        //void linkDetail_click(object sender, EventArgs ent)
        //{
        //    SecretPerson dlg = new SecretPerson();
        //    dlg.OptType = EOperateType.Detail;
        //    dlg.ShowDialog();
        //}
        //void linkVerify_click(object sender, EventArgs ent)
        //{
        //    Verify dlg = new Verify();
        //    dlg.ShowDialog();
        //}
    }
}
